import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import particulars from '../views/particulars.vue'
import Shopping from '../views/Shopping.vue'
import search from '../views/search.vue'
import listParticulars from '../views/listParticulars.vue'
import UserMine from '../views/UserMine.vue'
import UserLogin from '../views/UserLogin.vue' 
import UserAdministration from '../views/UserAdministration.vue'
import collect from '../views/collect.vue'
import AllOrders from '../views/All_Orders.vue'
import ConfirmOrder from '../views/ConfirmOrder.vue'
import AddressManagement from '../views/AddressManagement.vue'
import address from '../views/address.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  // 详情
  {
	path: '/particulars',
	name: 'Particulars',
	component: particulars
  },
  // 购物车
  {
  	path: '/Shopping',
  	name: 'Shopping',
  	component: Shopping
  },
  // 搜索
  {
  	path: '/search',
  	name: 'search',
  	component: search
  },
  // list详情
  {
  	path: '/listParticulars',
  	name: 'listParticulars',
  	component: listParticulars
  },
  // 我的页面
  {
  	path: '/UserMine',
  	name: 'UserMine',
  	component: UserMine
  },
  // 登录
  {
  	path: '/UserLogin',
  	name: 'UserLogin',
  	component: UserLogin
  },
  // 用户管理
  {
  	path: '/UserAdministration',
  	name: 'UserAdministration',
  	component: UserAdministration
  },
  // 收藏
  {
  	path: '/collect',
  	name: 'collect',
  	component: collect
  },
  // 全部订单
  {
  	path: '/AllOrders',
  	name: 'AllOrders',
  	component: AllOrders
  },
  // 确定订单
  {
  	path: '/ConfirmOrder',
  	name: 'ConfirmOrder',
  	component: ConfirmOrder
  },
  // 地址管理
  {
  	path: '/AddressManagement',
  	name: 'AddressManagement',
  	component: AddressManagement
  },
  // 地址添加
  {
  	path: '/address',
  	name: 'address',
  	component: address
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: function () {
      return import(/* webpackChunkName: "about" */ '../views/About.vue')
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
